#include "Prototype.h"
#include "iostream"

using namespace std;

Prototype::Prototype()
{
	cout << "Prototype()" <<endl;
}

Prototype::~Prototype()
{
	cout << "~Prototype()" << endl;
}

ConcretePrototypeA::ConcretePrototypeA()
{
	cout << "ConcretePrototypeA()" << endl;
}

ConcretePrototypeA::~ConcretePrototypeA()
{
	cout << "~ConcretePrototypeA()" << endl;
}

ConcretePrototypeA::ConcretePrototypeA(const ConcretePrototypeA& other)
{
	cout << "COPY ConcretePrototypeA"<<endl;
	m_num = other.m_num;
}

Prototype* ConcretePrototypeA::Clone() const
{
	return new ConcretePrototypeA(*this);
}

void ConcretePrototypeA::set(int data)
{
	m_num = data;
}

void ConcretePrototypeA::get()
{
	cout<<m_num<<endl;
}

ConcretePrototypeB::ConcretePrototypeB()
{
	cout << "ConcretePrototypeB()" << endl;
}

ConcretePrototypeB::~ConcretePrototypeB()
{
	cout << "~ConcretePrototypeB()" << endl;
}

ConcretePrototypeB::ConcretePrototypeB(const ConcretePrototypeB& other)
{
	cout << "COPY ConcretePrototypeB"<<endl;
	m_num = other.m_num;
}

Prototype* ConcretePrototypeB::Clone() const
{
	return new ConcretePrototypeB(*this);
}

void ConcretePrototypeB::set(int data)
{
	m_num = data;
}

void ConcretePrototypeB::get()
{
	cout<<m_num<<endl;
}